package cn.doitedu.basic.utils;

import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;

import java.util.List;

/**
 * Created by yuanhailong on 2021/9/16.
 *
 * Apache CommonConfiguration 测试
 */
public class CommonConfigurationDemo {


    static Configuration configuration;

    static {

        try {
            configuration=new PropertiesConfiguration("db.properties");
        } catch (ConfigurationException e) {
            e.printStackTrace();
        }
    }



    public static void main(String[] args) {

        String user = configuration.getString("user");
        String user1 = configuration.getString("user:root");
        List list = configuration.getList("password");
        System.out.println(user);

    }

}
